//
//  ConsultDetailViewCellViewController.m
//  homeland
//
//  Created by caesar on 14-8-4.
//  Copyright (c) 2014年 xzysun. All rights reserved.
//

#import "ConsultDetailViewCellViewController.h"
#import "WaiterConsult.h"
#import "CommonUtil.h"

@interface ConsultDetailViewCellViewController ()

@end

@implementation ConsultDetailViewCellViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"详情";
    WaiterConsult * wc =  [_config objectForKey:@"dataItem"] ;
    self.titleLable.text = [CommonUtil dealNullObject:wc.title];
    self.consultDateLable.text = [CommonUtil formatDateStr:[CommonUtil dealNullObject:wc.insertTime] style:@"yyyy-MM-dd"];
    NSString *stateStr;
    if (!wc.replyStatus || [wc.replyStatus isEqualToString:@"0"] ) {
        stateStr = @"未回复";
    }else{
        stateStr = @"已回复";
    }
    self.state.text = stateStr;
    self.consultContent.text = [CommonUtil dealNullObject:wc.content];
    self.replyDate.text = [CommonUtil formatDateStr:[CommonUtil dealNullObject:wc.replyTime]style:@"yyyy-MM-dd"];
    self.replyContent.text = [CommonUtil dealNullObject: wc.replyContent];
    [self.myScrollView addSubview:self.myView];
    self.myScrollView.contentSize = self.myView.frame.size;
    [self.view addSubview:self.myScrollView];
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
